import {
  version1,
  platformApi,
  downplatformApi,
  downstatsApi,
} from '../src/api';

const delay = (ms: number) =>
  new Promise(resolve => {
    setTimeout(resolve, ms);
  });

export default {
  // 1. 平台视频图像数据
  [`GET ${version1}${platformApi}`]: (req: any, res: any) => {
    delay(1000);
    res.send({
      data: {
        uplinks: 10,
        videos: 10,
        pictures: 10,
        gpu_perf_max: 10,
        gpu_perf: 10,
        today_pictures: 10,
        today_videos: 10,
        used_storage: 1024000000000000,
        total_storage: 102400000000000000,
        up_platforms: 10,
        up_platform_devices: 10,
        up_platform_access: 10,
      },
      message: '',
      request_id: '56e83d08ea1e4c209af9b857c2a9abf8',
    });
  },

  // 2. 下级平台视频图像数据
  [`GET ${version1}${downplatformApi}`]: (req: any, res: any) => {
    delay(1000);
    res.send({
      data: {
        sdk_devices: 10,
        sdk_online_devices: 10,
        cig_channels: 10,
        cig_online_channels: 10,
        cigs: 10,
        online_cigs: 10,
        down_platforms: 10,
        online_down_platforms: 10,
        sdk_uplinks: 10,
        cig_uplinks: 10,
        down_platform_uplinks: 10,
        uplinks: 10,
        videos: 10,
        pictures: 10,
        used_storage: 1000000000,
        total_storage: 10000000000000000,
        gpu_perf_max: 10,
        gpu_perf: 10,
      },
      message: '',
      request_id: '56e83d08ea1e4c209af9b857c2a9abf8',
    });
  },

  // 3. 下级平台统计服务列表
  [`GET ${version1}${downstatsApi}`]: (req: any, res: any) => {
    delay(1000);
    res.send({
      data: [
        {
          name: '南昌县',
          host: 'https://yuanping-api.antelope.cn',
          sign_id: 'lapp',
          sign_key: '',
          created: 1603071675,
          updataed: 1603071675,
        },
        {
          name: '南昌县11',
          host: 'https://yuanping-api.antelope.cn',
          sign_id: 'lapp',
          sign_key: '',
          created: 1603071675,
          updataed: 1603071675,
        },
      ],
      message: '',
      request_id: '56e83d08ea1e4c209af9b857c2a9abf8',
    });
  },
};
